<?php  
/**
* View
* Отображение
* @author IT studio IRBIS-team
* @copyright © 2009 IRBIS-team
*/
/////////////////////////////////////////////////////////

/**
* Generation of page of an error at access out of system
* Генерация страницы ошибки при доступе вне системы
*/
    if(!defined('IRB_KEY'))
    {
       header("HTTP/1.1 404 Not Found");      
       exit(file_get_contents('../../404.html'));
    }    
///////////////////////////////////////////////////////////

    $POST = htmlChars($POST);
	
	switch($GET['rem'])
		{
/** 
* Requests page
* Страничка заявок
*/			
		case 'read':
		//include './skins/tpl/'. $modul .'/show_nav.tpl';
		if(isset($GET['view']) AND $GET['view'] == 'table')
			include './skins/tpl/'. $modul .'/request_in_table.tpl';
		else
			include './skins/tpl/'. $modul .'/request_in_list.tpl';		
		break;
/** 
* Request add page
* Страничка добавления заявки
*/			
		case 'add':
			include './skins/tpl/'. $modul .'/form_add.tpl';
		break;
/** 
* Request page
* Страничка заявки
*/			
		case 'request':
		if(!empty($r))
			{
			if ($r['owner'] == (int)$_SESSION['user_data']['id'])
				include './skins/tpl/'. $modul .'/form_edit_request.tpl';
			else
				include './skins/tpl/'. $modul .'/request.tpl';
			}
		break;
/** 
* Request delete page
* Страничка удаления заявки
*/			
		case 'delete':
			include './skins/tpl/'. $modul .'/request_delete.tpl';
		break;
/** 
* Request close page
* Страничка закрытия заявки
*/			
		case 'close':
			include './skins/tpl/'. $modul .'/form_close_request.tpl';
		break;
		
		default:
		include './skins/tpl/'. $modul .'/show_nav.tpl';
		if (!empty($requests))
			{
			foreach($requests as $r_key => $r)
				{
				include './skins/tpl/'. $modul .'/request_in_list.tpl';
				}
			}
		}